Option Strict Off
Option Explicit On
Friend Class busqueda
	Inherits System.Windows.Forms.Form
	Private Sub busqueda_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		cmb_ensayo.SelectedIndex = 0
		Call busquedaQuimi("busqueda")
	End Sub
	Private Sub busqueda_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
		bandReporte = bandReporte : cadParametros = cadParametros : Me.Close()
	End Sub
	'UPGRADE_WARNING: Event cmb_buscar.SelectedIndexChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub cmb_buscar_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmb_buscar.SelectedIndexChanged
		Call mostarDatos("busqueda", cmb_buscar.Text) : cmb_datos.SelectedIndex = 0
		
	End Sub
	
	'UPGRADE_WARNING: Event opt_buscar.CheckedChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub opt_buscar_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles opt_buscar.CheckedChanged
		If eventSender.Checked Then
			If opt_buscar.Checked = True Then
				txt_param.Enabled = False
				cmb_buscar.Enabled = True
				cmb_datos.Enabled = True
				cmb_ensayo.Enabled = False
			End If
		End If
	End Sub
	
	'UPGRADE_WARNING: Event opt_ensa.CheckedChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub opt_ensa_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles opt_ensa.CheckedChanged
		If eventSender.Checked Then
			If opt_ensa.Checked = True Then
				txt_param.Enabled = False
				cmb_buscar.Enabled = False
				cmb_datos.Enabled = False
				cmb_ensayo.Enabled = True
			End If
		End If
	End Sub
	'UPGRADE_WARNING: Event opt_param.CheckedChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="88B12AE1-6DE0-48A0-86F1-60C0686C026A"'
	Private Sub opt_param_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles opt_param.CheckedChanged
		If eventSender.Checked Then
			If opt_param.Checked = True Then
				txt_param.Enabled = True
				cmb_buscar.Enabled = False
				cmb_datos.Enabled = False
				cmb_ensayo.Enabled = False
			End If
		End If
	End Sub
	Private Sub cmd_buscar_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmd_buscar.Click
		Dim aux As String
		'mostrar la lista nueva
		'Buscar por ensayos
		If opt_ensa.Checked = True Then
			If cmb_ensayo.SelectedIndex = 0 Then bandReporte = 1 : cadParametros = "" : Call busqueda_FormClosed(Me, New System.Windows.Forms.FormClosedEventArgs(0, FormAction.Closed))
			If cmb_ensayo.SelectedIndex = 1 Then bandReporte = 2 : cadParametros = "" : Call busqueda_FormClosed(Me, New System.Windows.Forms.FormClosedEventArgs(0, FormAction.Closed))
			'Buscar por parametro
		ElseIf opt_param.Checked = True And txt_param.Text <> "" Then 
			cadParametros = txt_param.Text : bandReporte = 4 : Call busqueda_FormClosed(Me, New System.Windows.Forms.FormClosedEventArgs(0, FormAction.Closed))
			'Buscar por atributos tabla
		ElseIf opt_buscar.Checked = True And cmb_buscar.Text <> "" Then 
			Select Case cmb_buscar.Text
				Case Is = "COSTO $" : aux = "subtotal_us"
				Case Is = "COSTO bs" : aux = "subtotal_bs"
				Case Is = "VALORES GUIA OMS" : aux = "valores_guia_OMS"
				Case Is = "TECNICA" : aux = "metodo"
				Case Is = "METODO NORMALIZADO APHA" : aux = "apha"
				Case Is = cmb_buscar.Text : aux = cmb_buscar.Text
			End Select
			
			bandReporte = 5 : cadParametros = aux & "/" & cmb_datos.Text : Call busqueda_FormClosed(Me, New System.Windows.Forms.FormClosedEventArgs(0, FormAction.Closed)) 'cmb_buscar
			'Todos
		Else
			bandReporte = 3 : cadParametros = "" : Call busqueda_FormClosed(Me, New System.Windows.Forms.FormClosedEventArgs(0, FormAction.Closed))
		End If
		
		
	End Sub
End Class